package jbl.action;

import jbl.pageModel.Gs;
import jbl.service.GsServiceI;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

/**
 * @author jblcxg
 * 
 * 快捷添加公司信息管理
 *
 */
@Namespace("/")
@Action(value="gsAction")
public class GsAction extends BaseAction  implements ModelDriven<Gs>{
	private GsServiceI gsService;
	private Gs gs = new Gs();

	
	@Override
	public Gs getModel() {
		return gs;
	}
	@Autowired
	public void setGsService(GsServiceI gsService) {
		this.gsService = gsService;
	}
	/**
	 * 获取公司信息dataGrid
	 */
	public void dataGrid(){
		super.writeJson(gsService.dataGrid());	//发送到前端页面
	}

	/**
	 * 删除公司信息
	 */
	public void delete(){
		writeJson(gsService.delete(gs.getIds()));//更新到前端页面
	}
	/**
	 * 修改公司信息
	 */
	public void edit(){
		writeJson(gsService.edit(gs));//更新前端页面
		
	}
	/**
	 * 添加公司信息
	 */
	public void add(){
		writeJson(gsService.add(gs));
	}
	/**
	 * 获取公司信息的下拉列表值
	 */
	public void comboboxInfo(){
		writeJson(gsService.comboboxInfo());
	}
}
